<template>
  <div>
    <!-- <van-cell title="任务id">{{taskId}}</van-cell> -->
    <van-cell title="类型" value="列检作业" />
    <van-cell title="状态">
      <van-tag type="danger">进行中</van-tag>
    </van-cell>
    <!-- <van-cell title="创建人" value="张三" />
    <van-cell title="创建时间" value="2022-07-25 09:06:31" />-->
    <van-cell title="计划时间" value="2022-08-19 14:00~15:00" />
    <van-cell title="开始时间" value="2022-08-19 14:01" />
    <van-cell title="结束时间" value="---" />
    <van-cell title="负责人" value="李四" />
    <van-cell title="列检员" value="赵六" />
    <van-cell title="列检区域" value="5G" />
    <van-cell title="围栏范围">
      <span :style="{color: 'blue'}">点击查看</span>
    </van-cell>
    <van-cell title="照片/视频" />
    <van-uploader v-model="fileList" multiple :after-read="afterRead" accept="image/*" />
  </div>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {},
  data() {
    return {
      taskId: '',
      fileList: [
        // {
        //   url: 'http://192.168.201.32:7777/pic_test/60004/lj01.jpeg'
        // },
        // {
        //   url: 'http://192.168.201.32:7777/pic_test/60004/lj02.jpeg'
        // }
                {
          url: 'http://172.24.100.128:7777/pic_test/60004/lj01.jpeg'
        },
        {
          url: 'http://172.24.100.128:7777/pic_test/60004/lj02.jpeg'
        }
      ]
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    // this.taskId = this.$router.currentRoute.query.id
    this.taskId = '0000026'
  },
  methods: {
    async afterRead(e) {
      // 此时可以自行将文件上传至服务器
      e.status = 'uploading'
      e.message = '上传中...'
      console.log('e')
      const fd = new FormData()
      fd.append('file', e.file)
      const res = await this.$http({
        method: 'post',
        url: 'http://172.24.100.128:7777/pic/upload',
        data: fd
      })
      console.log(res)
      e.status = 'done'
    }
  }
}
</script>

<style lang="less" scoped>
.van-cell {
  .van-cell__value {
    min-width: 70%;
  }
}
</style>
